package de.probstl.core.dao.hibernate;

import java.util.List;

import org.appfuse.dao.hibernate.GenericDaoHibernate;

import de.probstl.core.Vehicle;
import de.probstl.core.dao.VehicleDao;

/**
 * Hibernate implementation for accessing table vehicle
 */
public class VehicleDaoHibernate extends GenericDaoHibernate<Vehicle, Long>
		implements VehicleDao
{
	public VehicleDaoHibernate()
	{
		super(Vehicle.class);
	}

	@SuppressWarnings("unchecked")
	public List<Vehicle> findVehicleByUser(Long userid)
	{
		String query = "from de.probstl.core.Vehicle where owner_id=?";
		return getHibernateTemplate().find(query, userid);
	}
}
